package hips.images.floating;

import hips.Image;
import hips.Partition;

public abstract class ImageFloat<PixelVal extends PixelValueFloat<PixelVal>> extends Image<PixelVal> {

	public Partition<PixelVal> newPartition(int type, PixelVal alpha, PixelVal omega, float ci, int randomPixels) {
		if (type == Partition.ORIGINAL) {
			return new PartitionOriginalFloat<PixelVal>(this, alpha, omega, randomPixels);
		}
		if (type == Partition.IMPROVED_WITHOUT_CINDEX) {
			return new PartitionImprovedFloat<PixelVal>(this, alpha, omega, randomPixels);
		}
		if (type == Partition.IMPROVED_WITH_CINDEX) {
			return new PartitionCompleteFloat<PixelVal>(this, alpha, omega, ci, randomPixels);
		}
		return null;
	}

	public Partition<PixelVal> newPartition(int type) {
		if (type == Partition.ORIGINAL) {
			return new PartitionOriginalFloat<PixelVal>(this);
		}
		if (type == Partition.IMPROVED_WITHOUT_CINDEX) {
			return new PartitionImprovedFloat<PixelVal>(this);
		}
		if (type == Partition.IMPROVED_WITH_CINDEX) {
			return new PartitionCompleteFloat<PixelVal>(this);
		}
		return null;
	}
}